<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>H+ 后台主题UI框架 - 空白页</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="favicon.ico">   <link href="__STATIC__/layout/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__STATIC__/layout/css/font-awesome.css?v=4.4.0" rel="stylesheet">
     <!-- jqgrid-->
    <link href="__STATIC__/layout/css/animate.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="__STATIC__/layout/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/gyq.css" rel="stylesheet">
    <link rel="stylesheet" href="__STATIC__/layout/css/demo.css" type="text/css">
     <link rel="stylesheet" href="__STATIC__/layout/css/channel.css" type="text/css">
    <script src="__STATIC__/layout/js/jquery.min.js?v=2.1.4"></script>
    <script src="__STATIC__/sc/js/page.js"></script> 
</head>

<body style="color:#333;padding:3px;">
    <!-- 标题 -->
    <div class="page-heade">
      <h2 class="title_color text-center">所有供应商核销状况查询</h2>
    </div>
    <!-- 标题 -->
    <div class="form-inline">
    <form action="#" method="post" id="form_check" class="formpage">
               <input type="hidden" value='{$page}' name="page" id="page-go"/>
                      <input type="hidden" value='{$list}' name="list" id="list-go"/>
      <table class="row-margin-top tab-content table-bordered table" border="1">
          <tr>
            <td class="text-right" style="min-width: 120px;width: 120px"><label for="" class="form-label">供应商编号：</label></td>
            <td><input type="text" class="form-control" name="gys_no" value="{$data.gys_no}"></td>
            <td class="text-right" style="min-width: 120px;width: 120px"><label for="">供应商名称：</label></td>
            <td><input type="text" class="form-control" name="gys_name" value="{$data.gys_name}"></td>
            <td class="text-left" >
           <button class="btn btn-info query" type="button" id="check">查询</button>
           <button class="btn btn-info emptyIf" type="button" id="clear_check">清空查询条件</button>
          </td>
        </tr>
      </table>
    
      <table class="table table-striped row-margin-top table-bordered table-hover text-center bud_hei">
          <tr class="info text-center">
            <th class="text-center" rowspan="2">序号</th>
            <th class="text-center" rowspan="2">供应商编号</th>
            <th class="text-center" rowspan="2">供应商名称</th>
            <th class="text-center" rowspan="2">已批准</th>
            <th class="text-center" rowspan="2">已核销</th>
            <th class="text-center" colspan="2">未核销</th>
            <th class="text-center" rowspan="2">不予核销</th>
          </tr>
          <tr class="info">
            <th class="text-center">申请中</th>
            <th class="text-center">未申请</th>
          </tr>
          <tbody>
          {volist name="detail" id="vo"}
             <tr>
                  <td>{$i}</td>
                  <td>{$vo.gys_no}</td>
                  <td>{$vo.gys_name}</td>
                  <td >
                    {if $vo.pizhun eq 0}
                       0.00
                    {else/}
                      <a  class="approved num2 ObjectNum active" title="已批准金额详情" href="{:url('approvedPage')}?gid={$vo.id}">{$vo.pizhun}</a>
                    {/if}
                  </td>
                  <td>
                     {if $vo.yihe eq 0}
                       0.00
                    {else/}
                      <a class="vorified num2 ObjectNum " title="已核销金额详情" href="{:url('vorifiedPage')}?gid={$vo.id}">{$vo.yihe}</a>
                    {/if}
                  </td>
                  <td >
                     {if $vo.shenqing eq 0}
                       0.00
                    {else/}
                      <a class="applying num2 ObjectNum" title="申请中信息" href="{:url('applyingPage')}?gid={$vo.id}">{$vo.shenqing}</a>
                    {/if}
                  </td>
                  <td class="noapply num2 ObjectNum">{$vo.weihe}</td>
                  <td > {if $vo.buhe eq 0}
                       0.00
                    {else/}
                      <a class="novorified num2 ObjectNum" title="申请中信息" href="{:url('buhe')}?gid={$vo.id}">{$vo.buhe}</a>
                    {/if}
                  </td>
              </tr>
          {/volist}
             
             
          </tbody>
      </table>
        <h5 class="text-center" id="pagesc" style="font-size: 16px;font-weight: 500">
            <script>
                            $(function(){
                                pageSC("pagesc",{$sum},{$page},{$maxpage})
                            })
                        </script>
                         每页显示
           <select id="pagesize">
                        <option value='10' {if condition="$list eq 10"}selected{/if}>10条</option>
                        <option value='15'{if condition="$list eq 15"}selected{/if}>15条</option>
                        <option value='20'{if condition="$list eq 20"}selected{/if}>20条</option>

            </select>
        </h5>
</form>
    </div>
    <!-- 全局js -->
    <script src="__STATIC__/layout/js/bootstrap.min.js?v=3.3.6"></script>
    <!-- <script src="js/plugins/metisMenu/jquery.metisMenu.js"></script> -->
    <script src="__STATIC__/layout/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
    <script src="__STATIC__/layout/js/plugins/layer/laydate/laydate.js"></script>
    <script src="__STATIC__/layout/js/plugins/sweetalert/sweetalert.min.js"></script>
    <script src="__STATIC__/layout/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="__STATIC__/layout/js/plugins/layer/laydate/laydate.js"></script>
<script src="__STATIC__/layout/js/plugins/layer/layer.min.js"></script>

<script src="__STATIC__/layout/js/plugins/suggest/bootstrap-suggest.min.js"></script>
    <script src="__STATIC__/layout/js/common.js"></script>

    <script>
    $(".vorified").click(menuItem); $(".approved").click(menuItem);$(".applying").click(menuItem); $(".novorified").click(menuItem); 
    function menuItem() {
    // 获取标识数据
    var dataUrl = $(this).attr('href'),
        dataIndex = $(this).data('index'),
        menuName = $.trim($(this).attr("title")),
        flag = true;
    if (dataUrl == undefined || $.trim(dataUrl).length == 0)return false;

    // 选项卡菜单已存在
    top.$('.J_menuTab').each(function () {
        if ($(this).data('id') == dataUrl) {
            if (!$(this).hasClass('active')) {
                $(this).addClass('active').siblings('.J_menuTab').removeClass('active');
                scrollToTab(this);
                // 显示tab对应的内容区
                top.$('.J_mainContent .J_iframe').each(function () {
                    if (top.$(this).data('id') == dataUrl) {
                        top.$(this).show().siblings('.J_iframe').hide();
                        return false;
                    }
                });
            }
            flag = false;
            return false;
        }
    });

    // 选项卡菜单不存在
    if (flag) {
        var str = '<a href="javascript:;" class="active J_menuTab" data-id="' + dataUrl + '">' + menuName + ' <i class="fa fa-times-circle"></i></a>';
        top.$('.J_menuTab').removeClass('active');

        // 添加选项卡对应的iframe
        var str1 = '<iframe class="J_iframe" name="iframe' + dataIndex + '" width="100%" height="100%" src="' + dataUrl + '" frameborder="0" data-id="' + dataUrl + '" seamless></iframe>';
        top.$('.J_mainContent').find('iframe.J_iframe').hide().parents('.J_mainContent').append(str1);

        //显示loading提示
//            var loading = layer.load();
//
//            $('.J_mainContent iframe:visible').load(function () {
//                //iframe加载完成后隐藏loading提示
//                layer.close(loading);
//            });
        // 添加选项卡
        top.$('.J_menuTabs .page-tabs-content').append(str);
        scrollToTab(top.$('.J_menuTab.active'));
    }
    return false;
}
//滚动到指定选项卡
function scrollToTab(element) {
    var marginLeftVal = calSumWidth(top.$(element).prevAll()), marginRightVal = calSumWidth(top.$(element).nextAll());
    // 可视区域非tab宽度
    var tabOuterWidth = calSumWidth(top.$(".content-tabs").children().not(".J_menuTabs"));
    //可视区域tab宽度
    var visibleWidth = top.$(".content-tabs").outerWidth(true) - tabOuterWidth;
    //实际滚动宽度
    var scrollVal = 0;
    if (top.$(".page-tabs-content").outerWidth() < visibleWidth) {
        scrollVal = 0;
    } else if (marginRightVal <= (visibleWidth - top.$(element).outerWidth(true) - top.$(element).next().outerWidth(true))) {
        if ((visibleWidth - top.$(element).next().outerWidth(true)) > marginRightVal) {
            scrollVal = marginLeftVal;
            var tabElement = element;
            while ((scrollVal - top.$(tabElement).outerWidth()) > (top.$(".page-tabs-content").outerWidth() - visibleWidth)) {
                scrollVal -= top.$(tabElement).prev().outerWidth();
                tabElement = top.$(tabElement).prev();
            }
        }
    } else if (marginLeftVal > (visibleWidth - top.$(element).outerWidth(true) - top.$(element).prev().outerWidth(true))) {
        scrollVal = marginLeftVal - top.$(element).prev().outerWidth(true);
    }
    top.$('.page-tabs-content').animate({
        marginLeft: 0 - scrollVal + 'px'
    }, "fast");
}
//计算元素集合的总宽度
function calSumWidth(elements) {
    var width = 0;
    top.$(elements).each(function () {
        width += top.$(this).outerWidth(true);
    });
    return width;
}

    $('.approved').on('click',menuItem);
        $(document).ready(function(){
              $(".num2").each(function(){
        $(this).html(parseFloat($(this).html()).toFixed(2));
     })
         
         var $ObjectNum =$(".ObjectNum");
               toNum($ObjectNum);
        })

            //翻页
       
        $("#check").click(function(){
              $("#page-go").val(1);
              $(".formpage").submit();
        })
        $("#clear_check").click(function(){
            $("input[type='text']").val("");
            $("#page-go").val(1);
            $(".formpage").submit();
        })
    </script>
</body>

</html>
